package com.wffz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wffz.dto.RewardDTO;
import com.wffz.po.Reward;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author sunlei
 * @Description RewardMapper
 * @date 2023/4/9 17:16
 **/
public interface RewardMapper extends BaseMapper<Reward> {

    @Select("SELECT  r.id,r.reward_icon,r.reward_title,r.reward_content,r.reward_btn,r.remark,wur.user_id FROM wffz_reward r left join wffz_user_reward wur on r.id = wur.reward_id WHERE user_id = #{userId}")
    List<RewardDTO> getRewardUserList(@Param("userId") long userId);

}
